﻿@using FwProject.Distribution.Dto.Statistics
@model List<DistributionProductStatisticsDto>
@{
    Layout = null;
    int distribution = 0;
    int distributionset = 0;
    int recovery = 0;
    int recoveryset = 0;
    int exchangegoods = 0;
    int exchangegoodsset = 0;
    int give = 0;
    int giveset = 0;
    int backBox = 0;
    int backNumber = 0;
    int damage = 0;
}
<div id="table_print">
    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th>商品名称</th>
                <th>配送箱数</th>
                <th>配送套数</th>
                <th>回收箱数</th>
                <th>回收套数</th>
                <th>换货箱数</th>
                <th>换货套数</th>
                <th>赠送箱数</th>
                <th>赠送套数</th>
                <th>退回箱数</th>
                <th>退回套数</th>
                <th>折损套数</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr><td class="text-center" colspan="8">暂无信息</td></tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    distribution = distribution + item.DistributionCount;
                    distributionset += item.DistributionSetCount;
                    recovery = recovery + item.RecoveryCount;
                    recoveryset += item.RecoverySetCount;
                    exchangegoods = exchangegoods + item.ExchangegoodsCount;
                    exchangegoodsset += item.ExchangegoodsSetCount;
                    give = give + item.GiveCount;
                    giveset += item.GiveSetCount;
                    backBox = backBox + item.BackBoxCount;
                    backNumber = backNumber + item.BackNumberCount;
                    damage = damage + item.DamageCount;
                    <tr>
                        <td>@item.ProductName</td>
                        <td>@item.DistributionCount</td>
                        <td>@item.DistributionSetCount</td>
                        <td>@item.RecoveryCount</td>
                        <td>@item.RecoverySetCount</td>
                        <td>@item.ExchangegoodsCount</td>
                        <td>@item.ExchangegoodsSetCount</td>
                        <td>@item.GiveCount</td>
                        <td>@item.GiveSetCount</td>
                        <td>@item.BackBoxCount</td>
                        <td>@item.BackNumberCount</td>
                        <td>@item.DamageCount</td>
                    </tr>
                }
                <tr class="footer">
                    <td class="text-center" style="color:red;">合计</td>
                    <td style="color:red;">@distribution</td>
                    <td style="color:red;">@distributionset</td>
                    <td style="color:red;">@recovery</td>
                    <td style="color:red;">@recoveryset</td>
                    <td style="color:red;">@exchangegoods</td>
                    <td style="color:red;">@exchangegoodsset</td>
                    <td style="color:red;">@give</td>
                    <td style="color:red;">@giveset</td>
                    <td style="color:red;">@backBox</td>
                    <td style="color:red;">@backNumber</td>
                    <td style="color:red;">@damage</td>
                </tr>
            }
        </tbody>
    </table>

</div>

